
import { request} from "../../request/index"
import regeneratorRuntime from "../../lib/runtime/runtime.js";
import {login} from "../../utils/asyncWx.js"
Page({
// 获取用户信息
async handleGetUserInfo(e){
//1 获取用户信息
const {encryptedData,rawData,iv,signature}=e.detail;
// 2 获取小程序登录成功后的code
    const {code}=await login();
    // 声明变量保存参数
    const loginParams={encryptedData,rawData,iv,signature,code}
//  3 发送请求 获取用户的token
const res=await request({url:"/users/wxlogin",data:loginParams,method:"post"});
console.log(res)
}
})